Auto merge of #3144 - alexcrichton:less-update-registry, r=brson
authorbors <bors@rust-lang.org>
Wed, 5 Oct 2016 23:22:25 +0000 (16:22 -0700)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2016 23:22:25 +0000 (16:22 -0700)
commit80d20e90d6666a8efed0224d9b3b82a6636da98d
treea42be272ff36719df3df6f5e72f4786bf39443e2
parent85df1880d84a83dfb28a2ec825f4c1abef3aac9e
parentc0306a8abf6b1722ab3c8ea53cc211a3e1906f17
Auto merge of #3144 - alexcrichton:less-update-registry, r=brson

Avoid updating registry when adding existing deps

Cargo previously erroneously updated the registry whenever a new dependency was
added on a crate which already exists in the DAG. This commit fixes this
behavior by ensuring that if the new dependency matches a previously locked
version it uses that instead.

This commit involved a bit of refactoring around this logic to be a bit more
clear how the locking and "falling back to the registry" is happening.

Closes #2895